<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>直联商户商户交易查询</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<!-- 当前页面样式 END -->
<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript">
$(document).ready(function(){
		$('#sub').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/unpayStatement/queryUnpayStatement.ct");
			$("#queryForm").submit();
			$(this).attr("disabled","true");
		});
		
		$('#exportlist').click(function(){
			var start = $("#startDate").val();
			var end=$("#endDate").val();
			if(start==null ||start==0||end==null||end==0){
		   		alert("请选择交易日期");
		   		return false;
		   }else{
				$("#queryForm").attr("action","<%=basePath%>/unpayStatement/exportUnpayStatement.ct");
				$("#queryForm").submit();
				$(this).attr("disabled","true");
		   }
		});
		
	});	
	
</script>
</head>

<body>
		<s:form id="queryForm" action="/unpayStatement/queryUnpayStatement.ct" method="post" theme="simple">
			<table class="tb">
				<tbody>
				<tr class="tb-line">
            		<td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				 <tr class="tb-line">
					<td class="tb-td" colspan="4">
						<div class="tb-h3">直联商户商户交易查询</div>
					</td>
				</tr>

				<tr class="tb-line">
				 	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4">商户号</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.merchantNo" cssClass="queryWidth" />
							</label>
					</td>
					
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4">终端号</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.terminalNo" cssClass="queryWidth" />
							</label>
					</td>
				</tr>
					
				<tr class="tb-line">
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4">交易卡号</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.accountNo" cssClass="queryWidth" />
							</label>
					</td>
					
			        <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">机构号：</div>
            		</td>
            		<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.branch" cssClass="queryWidth" />
							</label>
					</td>
					</tr>
					<tr class="tb-line">
						<td width="12%" style="min-width: 150px" align="right" class="tb-td">
	                	<div class="tb-h4">是否清算：</div>
	            		</td>
						<td class="tb-td">
	                	<label class="tb-select">
							<s:select name="searchCondition.isHandle" list="#{'Y':'是','N':'否'}" headerKey="" headerValue="不限" cssClass="queryWidth" /> 
						</label>
						</td>
					
					
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">交易日期：</div>
            		</td>
					<td class="tb-td">
						<s:textfield  id="startDate" name="searchCondition.startDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
									theme="simple" /> &nbsp;至 &nbsp; <s:textfield id="endDate" name="searchCondition.endDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
									theme="simple" />
					</td>				
                								
				</tr>
				
				<tr>
						<td colspan="4" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
           		 <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
				<label class="tb-input-submit"><s:reset value="取 消" /></label> 
				<label class="tb-input-submit"><input type="button" value="导出清算报表" id="exportlist"/></label>	 
				</td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="4"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/unpayStatement/queryUnpayStatement.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
	</s:form>		
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="17"><div class="tb-h3">银联直联商户交易信息列表</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
					 	<%-- <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
                   			<th class="tb-th">选择</th>
                		</s:if> --%>
						<th class="tb-th">商户号</th>
						<th class="tb-th">终端号</th>				
						<th class="tb-th">流水号</th>
                		<th class="tb-th">机构号</th>
                		<th class="tb-th">交易标识</th>				 	
						<th class="tb-th">交易卡号</th>
						<th class="tb-th">交易金额（元）</th>
						<th class="tb-th">交易结果</th>						
						<th class="tb-th">卡类型</th>
						<th class="tb-th">是否清算</th>
						<th class="tb-th">交易金额（元）</th> 
						<th class="tb-th">手续费（元）</th>
						<th class="tb-th">结算金额（元）</th>
						<th class="tb-th">交易日期</th>
						<th class="tb-th">结算日期</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.searchRsList" status="stat" id="bean">
							<tr class="tb-line" >							
							<%-- <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
							<td class="tb-td" align="center">
                   			<input name="multi_sel" value="<s:property value="#bean.id"/>" type="checkbox" />
                   			</td>
                			</s:if> --%>
							<td class="tb-td"><s:property value="#bean.merchantNo"/></td>
							<td class="tb-td"><s:property value="#bean.terminalNo"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.serialNo"/></td>
                			<td class="tb-td"><s:property value="#bean.branch"/></td>
                			<td class="tb-td"><s:property value="#bean.sysNo"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.account"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.amt"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.transResult"/></td>
							<td class="tb-td">
								<s:if test="#bean.cardType == \"1\"">借记卡</s:if>
								<s:else >贷记卡</s:else>
							</td>
							<td class="tb-td">
								<s:if test="#bean.isHandle==\"Y\"">是</s:if>
								<s:else >否</s:else>
							</td>
							
							<td class="tb-td" align="center"><s:property value="#bean.transAmt"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.fee"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.settleAmt"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.transDate"/></td>
							<td class="tb-td" align="center"><s:property value="#bean.settleDate"/></td>
						</s:iterator>
						 
						 <s:if test="#request.msge!=null">
		                  <tr>
		                  <td  align='center' colspan='20'>
		                  		${msge}
		                  </td>
		                  </tr>
		                  
						
					   </s:if>
				</tbody>
			</table>
			</div>
		
	
</body>
</html>
